package com.lin.game.service;
import com.lin.game.entity.BeanHistory;
import com.lin.game.dao.BeanHistoryDao;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BeanHistoryServiceImpl implements IBeanHistoryService{
    @Autowired
    private BeanHistoryDao beanHistoryDao;

    @Override
    public int insertHistory(BeanHistory beanHistory) {
        return beanHistoryDao.insert(beanHistory);
    }

    @Override
    public List<BeanHistory> queryHistoryByUid(Integer uid) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("u_id", uid);
        return beanHistoryDao.selectList(queryWrapper);
    }
}
